package com.example.lol.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.lol.R;
import com.example.lol.bean.NewsArticleBean;

import org.jetbrains.annotations.NotNull;

public class NewsArticleAdapter extends BaseQuickAdapter<NewsArticleBean, BaseViewHolder> {

    public NewsArticleAdapter() {
        super(R.layout.home_page_middle_new);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NewsArticleBean newsArticleBean) {
        baseViewHolder.setText(R.id.home_page_middle_new_main,newsArticleBean.getTitle());
        baseViewHolder.setText(R.id.home_page_middle_new_lol,newsArticleBean.getLol1());
        baseViewHolder.setText(R.id.home_page_middle_new_lol2,newsArticleBean.getLol2());
        baseViewHolder.setImageResource(R.id.home_page_middle_new_read_img,newsArticleBean.getReadimg());
        baseViewHolder.setText(R.id.home_page_middle_new_read,newsArticleBean.getRead());
        baseViewHolder.setImageResource(R.id.home_page_middle_new_img,newsArticleBean.getIcon());

    }
}
